#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTcpServer>
#include <QTcpSocket>
#include <QLabel>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    void BeginListen();
    void CloseListen();
    void OnNewConnect();
    void OnDisConnect();
    void OnReadyRead();
private slots:
    void on_start_listen_button_clicked();

    void on_send_msg_button_clicked();

private:
    Ui::MainWindow *ui;
    QTcpServer *tcp_server_;
    QTcpSocket *tcp_socket_;
    QLabel     *status_label_;
};
#endif // MAINWINDOW_H
